import java.util.ArrayList;

public class ArrayList_02 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("shuzijun");
        arrayList.add("abc");
        arrayList.add("123");
//        System.out.println(arrayList.get(0));
//        System.out.println(arrayList.get(1));
//        System.out.println(arrayList.get(2));
        //遍历集合的通用写法
        for (int i=0;i<arrayList.size();i++){
            String s = arrayList.get(i);
            System.out.println(s);
        }
    }
}
